<?php
  echo $this->Html->script('validate_frm',FALSE);
  ?>
<div class="row-fluid offset2">
<div class="span10">
    <div class="box paint color_10">
        <div class="title">
            <h4> <i class="icon-book"></i><span><?php echo  (!empty($chitiet))?'Cập Nhật ':'Thêm Mới ';?>Người Dùng</span> </h4>
        </div>
        <div class="content">
            <form class="form-horizontal cmxform" id="validateForm" method="post" action="" autocomplete="off" enctype="multipart/form-data" >
                  <?php
                  if(!empty($chitiet))
                  echo '<input value="'.$chitiet[0]['User']['id'].'" name="data[User][id]" style="display:none;"/>';

                  ?>
                <div class="form-row control-group row-fluid">
                    <label class="control-label span2">Tài Khoản :  </label>
                    <div class="controls span9">
                        <input id="cname" name="data[User][username]" type="text" value='<?php echo (!empty($chitiet))?$chitiet[0]['User']['username']:'';?>' required class="span12"/>
                    </div>
                </div>
                <div class="form-row control-group row-fluid">
                    <label class="control-label span2" for="search-input">Ảnh Đại Diện</label>
                    <div class="controls span9">
                        <div class="input-append row-fluid">
                            <input type="file" name="data[User][img]" class="spa1n6 fileinput" id="search-input">
                             </div>
                    </div>
                </div>
                <div class="form-row control-group row-fluid">
                    <label class="control-label span2">Mật Khẩu  <?php echo (!empty($chitiet))?'Mới':''; ?>: </label>
                    <div class="controls span9 ">
                        <div class="input-prepend row-fluid"> <span class="add-on"><i class="icon-lock"></i></span>
                            <input class="row-fluid" type="password" id="password" name="data[User][password]" placeholder="min 5 characters">
                        </div>
                    </div>
                </div>
                <div class="form-row control-group row-fluid">
                    <label class="control-label span2" >Họ Tên Đầy Đủ : </label>
                    <div class="controls span9">
                        <input id="cname2" name="data[User][fullname]" value='<?php echo (!empty($chitiet))?$chitiet[0]['User']['fullname']:'';?>' minlength="3" type="text" required class="row-fluid"/>
                    </div>
                </div>
                <div class="form-row control-group row-fluid">
                    <label class="control-label span2">Giới Tính : </label>
                    <div class="controls span9">
                        <fieldset>
                            <label class="radio">
                                <input type="radio" name="data[User][gioitinh]" value="0" <?php if(!empty($chitiet)){ echo ($chitiet[0]['User']['gioitinh']==0)?'checked="checked"':'';} else echo 'checked="checked"'; ?>/>
                                Nam </label>
                            <label class="radio ">
                                <input type="radio" name="data[User][gioitinh]" value="1" <?php if(!empty($chitiet)){ echo ($chitiet[0]['User']['gioitinh']==1)?'checked="checked"':'';}?>/>
                                Nữ </label>
                        </fieldset>
                    </div>
                </div>
                <div class="form-row control-group row-fluid ">
                    <label class="control-label span2" for="mask-phone">Số Điện Thoại : </label>
                    <div class="controls span9">
                        <input id="mask-phone" type="text" tabindex="3" class="row-fluid" name="data[User][phone]" value='<?php echo (!empty($chitiet))?$chitiet[0]['User']['phone']:'';?>'>
                    </div>
                </div>
                <div class="form-row control-group row-fluid">
                    <label class="control-label span2">Địa Chỉ Email :  </label>
                    <div class="controls span9">
                        <input id="cemail" type="email" name="data[User][email]" value='<?php echo (!empty($chitiet))?$chitiet[0]['User']['email']:'';?>' required class="row-fluid"/>
                    </div>
                </div>
                <div class="form-row control-group row-fluid">
                    <label class="control-label span2">Nơi Ở Hiện Tại : </label>
                    <div class="controls span9">
                        <input id="" type="text" name="data[User][diachi]" value='<?php echo (!empty($chitiet))?$chitiet[0]['User']['diachi']:'';?>' required class="row-fluid"/>
                    </div>
                </div>
                <div class="form-row control-group row-fluid">
                    <label class="control-label span2">Thông Tin : </label>
                    <div class="controls span9">

                        <!-- Gets replaced with TinyMCE, remember HTML in a textarea should be encoded -->
                        <textarea id="elm3" name="data[User][about_me]" rows="30" cols="80" style="width: 100%;">
<?php echo (!empty($chitiet))?$chitiet[0]['User']['fullname']:'';?>
                        </textarea>

                    </div>
                </div>


                <div class="form-actions row-fluid">
                    <div class="span7 offset5">
                        <button type="submit" class="btn btn-primary">Save changes</button>
                        <button type="reset" class="btn btn-secondary">Cancel</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
    <!-- End .box -->
</div>
</div>
<!-- End .span8 -->
</div>